package com.felight.ems.strings;
import java.util.*;

class ScannerDemo{
	
	 
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		System.out.println("Enter your name");
		String name = in.nextLine();
		System.out.println("Hello!!"+name);
		System.out.println("please enter the number from which you want to start printing even number");
		int from = in.nextInt();
		System.out.println("please enter the number in which you want to stop printing even number");
		int to = in.nextInt();
		System.out.println("The even number between "+from+" and "+to+" are\n");
		generateEvenArray(from,to);
	}
	public static int[] generateEvenArray(int from,int to){
		 int[] result = new int[50];
		for(int i=from,j=0;i<=to;i++,j++){
			if(i%2==0){
				result[j]=i;
				System.out.println(result[j]);
			}
				
			else
				j--;
		}
			
		return result;
	}
}